from ultralytics import YOLO


if __name__ == '__main__':

    model = YOLO("yolov8n.pt")

    model.train(data="/Volumes/data/神经网络数据集/数据集1和3/union.yml",
                epochs=200)

    model.val()

    print("train success ")

    # model = YOLO("hemlet_best_1.pt")
    # results = model("D:\\神经网络数据集\\头盔检测\\数据集1\\Safety Helmet Detection_datasets\\images\\train\\hard_hat_workers16.png")
    # results = model("D:\\神经网络数据集\\头盔检测\\数据集3\\VOCdevkit\\VOCdevkit\\images\\train\\000219.jpg")
    # results = model("D:\\神经网络数据集\\头盔检测\\数据集3\\VOCdevkit\\VOCdevkit\\images\\train\\000246.jpg")
    # results = model("D:\\神经网络数据集\\头盔检测\\数据集3\\VOCdevkit\\VOCdevkit\\images\\train\\000250.jpg")
    # print(results)